home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 248_01 / ibmpc.c < prev    next >
Text File  |  1989-08-16  |  2KB  |  96 lines

  1. /*    IBMPC:    IBMPC I/O routines for MicroSPELL 1.0
  2.         Spell Checker and Corrector
  3.  
  4.         (C)opyright May 1987 by Daniel Lawrence
  5.         All Rights Reserved
  6. */
  7.  
  8. #include    <stdio.h>
  9. #include    "dopt.h"
  10. #include    "dstruct.h"
  11. #include    "ddef.h"
  12.  
  13. #if    IBMPC
  14. union REGS rg;            /* cpu register for use of DOS calls */
  15.  
  16. TTopen()        /* open the IBM-PC screen */
  17.  
  18. {
  19.     return(TRUE);
  20. }
  21.  
  22. TTclose()        /* close the IBM-PC screen */
  23.  
  24. {
  25.     return(TRUE);
  26. }
  27.  
  28. TTkopen()    /* open the keyboard */
  29.  
  30. {
  31.     return(TRUE);
  32. }
  33.  
  34. TTkclose()    /* close the keyboard */
  35.  
  36. {
  37.     return(TRUE);
  38. }
  39.  
  40. TTgetc(c)    /* get a character from the keyboard */
  41.  
  42. char c;        /* character to print */
  43.  
  44. {
  45.     /* call the dos to get a char */
  46.     rg.h.ah = 7;        /* dos Direct Console Input call */
  47.     intdos(&rg, &rg);
  48.     c = rg.h.al;        /* grab the char */
  49.     return(c & 255);
  50. }
  51.  
  52. TTputc(c)
  53.  
  54. char c;        /* character to print */
  55.  
  56. {
  57.     bdos(6, c, 0);
  58. }
  59.  
  60. TTflush()        /* flush the I/O  (nop) */
  61.  
  62. {
  63.     return(TRUE);
  64. }
  65.  
  66. TTmove(row, col)    /* move cursor to location on screen */
  67.  
  68. int row, col;
  69.  
  70. {
  71.     rg.h.ah = 2;        /* set cursor position function code */
  72.     rg.h.dl = col;
  73.     rg.h.dh = row;
  74.     rg.h.bh = 0;        /* set screen page number */
  75.     int86(0x10, &rg, &rg);
  76. }
  77.  
  78. TTbeep()    /* ring the bell */
  79.  
  80. {
  81.     TTputc(7);
  82. }
  83.  
  84. #if    0
  85. #define    TTeeol        (*term.t_eeol)
  86. #define    TTeeop        (*term.t_eeop)
  87. #define    TTrev        (*term.t_rev)
  88. #define    TTrez        (*term.t_rez)
  89. #if    COLOR
  90. #define    TTforg        (*term.t_setfor)
  91. #define    TTbacg        (*term.t_setback)
  92. #endif
  93. #endif
  94.  
  95. #endif
  96.